<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Laravel\Lumen\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * 应用程序提供的Artisan命令
     */
    protected $commands = [
        // 藏品状态更新回调
        \App\Console\Commands\ModifySpecialCallback::class,

        // 创作者入驻申请审核回调
        \App\Console\Commands\CheckMerchantsCallback::class,
    ];

    /**
     * 获取计划事件默认使用的时区
     */
    protected function scheduleTimezone()
    {
        return 'Asia/Shanghai';
    }

    /**
     * 定义应用程序的命令时间表
     */
    protected function schedule(Schedule $schedule)
    {
        // 藏品状态更新回调
        $schedule->command('modify_special_callback')->everyMinute()->runInBackground();

        // 创作者入驻申请审核回调
        $schedule->command('check_merchants_callback')->everyMinute()->runInBackground();
    }
}
